Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate from jest to vitest #518

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

TheMaskedTurtle
Copy link
Contributor

No description provided.

import react from '@vitejs/plugin-react';

export default defineConfig({
plugins: [react()],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need to redefine a vitestconfig file ?
"f you are using Vite and have a vite.config file, Vitest will read it to match with the plugins and setup as your Vite app. If you want to have a different configuration for testing [...] you could [...] create vitest.config.ts"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on other project, we set this directly on vite.config file with those parameters
test: { globals: true, environment: 'jsdom', setupFiles: './src/testSetup.ts', },
and the setup file, define a default config, like after afterEach(() => { cleanup() });

@@ -5,7 +5,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/

import { TextEncoder, TextDecoder } from 'util';
import { afterEach } from 'vitest';
import { cleanup } from '@testing-library/react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there was already a PR to add @testing-library/react https://github.com/gridsuite/commons-ui/pull/216/files?w=1 it simplifies the code we should use it if we add testing-library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants